<template>
	<view class="seckill-section m-t">
					<view class="s-header" @click="navTo('/pages/luckdraw/luckdraw')">
						<!-- <image src="https://edsfiles.oss-cn-shenzhen.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/h1.png"></image> -->
						<uni-icons type="icon-choujiang1" style="margin-right: 20rpx;
	" color="#fa436a" size="30"></uni-icons>
						<text class="tit">抽奖中心</text>
						<text class="tip">Lucky draw Center</text>		
						<text class="yticon icon-you"></text>
					</view>
					<scroll-view class="floor-list" scroll-x>
						<view class="scoll-wrapper">
							<view v-for="(item, index) in prizeList" :key="index" class="floor-item" @click="navToDrawDetail(item)">
								<image :src="item.cover_img" mode="aspectFill"></image>
								<text class="title clamp">{{item.title}}</text>
								<text class="price">￥{{item.prize.draw_money}}</text>
							</view>
						</view>
					</scroll-view>
				</view>
</template>

<script>
	import uniIcons from '../../ed-icons/ed-icons.vue'
	export default {
		name:"Draw",
		components:{
			uniIcons 
		},	
		props:{
			prizeList:{
				type:Array,
			}
		},
		data() {
			return {
				
			}
		},
		methods:{
			//抽奖详情页
			navToDrawDetail(item) {
				let cover_img=item.cover_img
				uni.navigateTo({
					url: `/pages/luckdraw/luckdrawdetail?data=${JSON.stringify(item.prize)}&cover_img=${cover_img}`
				})
			},
			navTo(url) {
				console.log(url)
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss">
/* 秒杀专区 */
	.seckill-section {
		padding: 4upx 30upx 24upx;
		background: #fff;

		.s-header {
			display: flex;
			align-items: center;
			height: 92upx;
			line-height: 1;

			.shop {
				font-size: 30upx;
			}

			.draw {
				color: #909399;
				margin-left: 15upx;
				font-size: 22upx;
			}

			.s-img {
				width: 140upx;
				height: 30upx;
			}

			.tip {
				font-size: $font-base;
				color: $font-color-light;
				margin: 0 20upx 0 40upx;
			}

			.timer {
				display: inline-block;
				width: 40upx;
				height: 36upx;
				text-align: center;
				line-height: 36upx;
				margin-right: 14upx;
				font-size: $font-sm+2upx;
				color: #fff;
				border-radius: 2px;
				background: rgba(0, 0, 0, .8);
			}

			.icon-you {
				font-size: $font-lg;
				color: $font-color-light;
				flex: 1;
				text-align: right;
			}
		}

		.floor-list {
			white-space: nowrap;
		}

		.scoll-wrapper {
			display: flex;
			align-items: flex-start;
		}

		.floor-item {
			width: 150upx;
			margin-right: 20upx;
			font-size: $font-sm+2upx;
			color: $font-color-dark;
			line-height: 1.8;

			image {
				width: 150upx;
				height: 150upx;
				border-radius: 6upx;
			}

			.price {
				color: $uni-color-primary;
			}
		}
	}

	.f-header {
		display: flex;
		align-items: center;
		height: 140upx;
		padding: 6upx 30upx 8upx;
		background: #fff;

		image {
			flex-shrink: 0;
			width: 80upx;
			height: 80upx;
			margin-right: 20upx;
		}

		.tit-box {
			flex: 1;
			display: flex;
			flex-direction: column;
		}

		.tit {
			font-size: $font-lg +2upx;
			color: #font-color-dark;
			line-height: 1.3;
		}

		.tit2 {
			font-size: $font-sm;
			color: $font-color-light;
		}

		.icon-you {
			font-size: $font-lg +2upx;
			color: $font-color-light;
		}
	}
</style>
